#define _CRT_SECURE_NO_WARNINGS 1

#include"Tree.h"

BinaryTreeNode* BuyNode(BTDataType x)
{
	BinaryTreeNode* node = (BinaryTreeNode*)malloc(sizeof(BinaryTreeNode));
	if (node == NULL)
	{
		perror("malloc fail!\n");
		exit(1);
	}
	node->data = x;
	node->left = node->right = NULL;
	return node;
}

BinaryTreeNode* CreateTreeNode()
{
	BinaryTreeNode* nodeA = BuyNode('A');
	BinaryTreeNode* nodeB = BuyNode('B');
	BinaryTreeNode* nodeC = BuyNode('C');
	BinaryTreeNode* nodeD = BuyNode('D');
	BinaryTreeNode* nodeE = BuyNode('E');
	BinaryTreeNode* nodeF = BuyNode('F');
	nodeA->left = nodeB;
	nodeA->right = nodeC;
	nodeB->left = nodeD;
	nodeC->left = nodeE;
	nodeC->right = nodeF;
	return nodeA;
}

void test()
{
	BinaryTreeNode* root = CreateTreeNode();
	printf("%d\n", BinaryTreeLevelKSize(root, 3));
	printf("%d\n", BinaryTreeDepth(root));
}

int main()
{
	test();
    return 0;
}